
# modify those variable for every environment
# VIRTUAL_HOME should match which setted in bash_profile
VIRTUAL_HOME=$HOME
VIRTUAL_DUTY=yc
VIRTUAL_CLUSTER="cluster-name"

export VIRTUAL_HOME
# Source global definitions
if [ -f /etc/bashrc ]; then
    # echo "souring... global bash env: /etc/bashrc"
    . /etc/bashrc
fi

export VIRTUAL_RC_HOME=$VIRTUAL_HOME/.ycrc
export BASH_ENV="$VIRTUAL_RC_HOME/bash_profile"
export ENV="$VIRTUAL_RC_HOME/bash_profile"
export PATH=/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
export LD_LIBRARY_PATH=/usr/local/lib
export CLASSPATH=.
export PS1='[\u@\h \W \#]\$ '
export HISTFILE="$VIRTUAL_RC_HOME/bash_history"
export HISTCONTROL=ignoredups
export HISTSIZE=40960
export HISTFILESIZE=819200
export HISTIGNORE="pwd:ls:la:ll:h:cd:cd -:cd ..:export:history:top"
export PROMPT_COMMAND="history -a"
export VIMINIT="source $VIRTUAL_RC_HOME/vimrc"

shopt -s histappend
history -c
history -r $VIRTUAL_RC_HOME/bash_history

unalias -a

# alias vi="vim -u $VIRTUAL_RC_HOME/vimrc -i $VIRTUAL_RC_HOME/viminfo -N"
alias vi="vim -i $VIRTUAL_RC_HOME/viminfo"
alias ls="ls --color=auto -F"
alias ll="ls -lh"
alias la="ls -A"
alias h="cd $VIRTUAL_HOME"
alias grep="grep --color"
alias pull="$VIRTUAL_RC_HOME/local/bin/pull_ftp.py"
alias push="$VIRTUAL_RC_HOME/local/bin/push_ftp.py"
alias create_project="$VIRTUAL_RC_HOME/local/vde/bin/create_project.py"
alias build_project="$VIRTUAL_RC_HOME/local/vde/bin/build_project.py"
alias open_project="$VIRTUAL_RC_HOME/local/vde/bin/open_project.py"

function gdb
{
    if [ $# -gt 1 ]; then
        echo "$@"
    fi
    eval "`which gdb` --quiet -nx -x $VIRTUAL_RC_HOME/gdbinit $@"
}
export -f gdb

# Source private definitions
if [ -f "$VIRTUAL_RC_HOME/bashrc.$VIRTUAL_DUTY" ]; then
    # echo "souring... private bash env: $VIRTUAL_RC_HOME/bashrc.$VIRTUAL_DUTY"
    . "$VIRTUAL_RC_HOME/bashrc.$VIRTUAL_DUTY"
fi

